package mytest.simple;

import org.apache.zookeeper.WatchedEvent;
import org.apache.zookeeper.Watcher;
import org.apache.zookeeper.Watcher.Event.EventType;

public class SimpleWatcher implements Watcher {
	
	/**
	 * 只能被触发一次，下次还需注册
	 * 
	 * 这里可以针对不用的EventType再触发监听
	 */
	@Override
	public void process(WatchedEvent event) {
		EventType type = event.getType();
		System.out.println("<<------");
		System.out.println(event.getPath());
		System.out.println(event.getType());
		System.out.println(event.getState());
		System.out.println("------->>");
		
	}
}
